package com.luhuiguo.cms.server.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.luhuiguo.cms.server.handler.ClearCacheHandler;
import com.luhuiguo.cms.server.handler.CreateArticleHandler;
import com.luhuiguo.cms.server.handler.CreateAttachmentHandler;
import com.luhuiguo.cms.server.handler.CreateChannelHandler;
import com.luhuiguo.cms.server.handler.CreateDraftArticleHandler;
import com.luhuiguo.cms.server.handler.GetArticleHandler;
import com.luhuiguo.cms.server.handler.GetAttachmentHandler;
import com.luhuiguo.cms.server.handler.GetChannelHandler;
import com.luhuiguo.cms.server.handler.GetCurrentUserHandler;
import com.luhuiguo.cms.server.handler.LoadArticlesHandler;
import com.luhuiguo.cms.server.handler.LoadAttachmentsHandler;
import com.luhuiguo.cms.server.handler.LoadChannelTreeHandler;
import com.luhuiguo.cms.server.handler.LoginHandler;
import com.luhuiguo.cms.server.handler.LogoutHandler;
import com.luhuiguo.cms.server.handler.RemoveArticleHandler;
import com.luhuiguo.cms.server.handler.RemoveArticlesHandler;
import com.luhuiguo.cms.server.handler.RemoveAttachmentsHandler;
import com.luhuiguo.cms.server.handler.RemoveChannelHandler;
import com.luhuiguo.cms.server.handler.RemoveDraftArticlesHandler;
import com.luhuiguo.cms.server.handler.UpdateArticleHandler;
import com.luhuiguo.cms.server.handler.UpdateAttachmentHandler;
import com.luhuiguo.cms.server.handler.UpdateChannelHandler;

/**
 * The spring java-based configuration for GWT dispatch handler.
 * 
 * @author LuHuiguo
 * @version $Id: HandlerConfig.java 150 2010-05-07 02:05:05Z luhuiguo@gmail.com
 *          $
 */
@Configuration
public class HandlerConfig {

    // ----- 用户安全 -----
    @Bean
    public LoginHandler loginHandler() {
        return new LoginHandler();
    }

    @Bean
    public LogoutHandler logoutHandler() {
        return new LogoutHandler();
    }

    @Bean
    public GetCurrentUserHandler getCurrentUserHandler() {
        return new GetCurrentUserHandler();
    }

    // ----- 缓存 -----
    @Bean
    public ClearCacheHandler clearCacheHandler() {
        return new ClearCacheHandler();
    }

    // ----- 栏目 -----
    @Bean
    public CreateChannelHandler createChannelHandler() {
        return new CreateChannelHandler();
    }

    @Bean
    public GetChannelHandler getChannelHandler() {
        return new GetChannelHandler();
    }

    @Bean
    public LoadChannelTreeHandler loadChannelTreeHandler() {
        return new LoadChannelTreeHandler();
    }

    @Bean
    public RemoveChannelHandler RemoveChannelHandler() {
        return new RemoveChannelHandler();
    }

    @Bean
    public UpdateChannelHandler updateChannelHandler() {
        return new UpdateChannelHandler();
    }

    // ----- 文章 -----
    @Bean
    public CreateArticleHandler createArticleHandler() {
        return new CreateArticleHandler();
    }

    @Bean
    public CreateDraftArticleHandler createDraftArticleHandler() {
        return new CreateDraftArticleHandler();
    }

    @Bean
    public GetArticleHandler GetArticleHandler() {
        return new GetArticleHandler();
    }

    @Bean
    public LoadArticlesHandler loadArticlesHandler() {
        return new LoadArticlesHandler();
    }

    @Bean
    public RemoveArticleHandler removeArticleHandler() {
        return new RemoveArticleHandler();
    }

    @Bean
    public RemoveArticlesHandler removeArticlesHandler() {
        return new RemoveArticlesHandler();
    }

    @Bean
    public RemoveDraftArticlesHandler removeDraftArticlesHandler() {
        return new RemoveDraftArticlesHandler();
    }

    @Bean
    public UpdateArticleHandler updateArticleHandler() {
        return new UpdateArticleHandler();
    }

    // ----- 附件 -----
    @Bean
    public CreateAttachmentHandler createAttachmentHandler() {
        return new CreateAttachmentHandler();
    }

    @Bean
    public GetAttachmentHandler GetAttachmentHandler() {
        return new GetAttachmentHandler();
    }

    @Bean
    public LoadAttachmentsHandler loadAttachmentsHandler() {
        return new LoadAttachmentsHandler();
    }

    @Bean
    public RemoveAttachmentsHandler removeAttachmentsHandler() {
        return new RemoveAttachmentsHandler();
    }

    @Bean
    public UpdateAttachmentHandler updateAttachmentHandler() {
        return new UpdateAttachmentHandler();
    }
}
